package com.action;

import com.service.ServiceB;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//http://127.0.0.1:7002/actuator/refresh
@RestController
@RefreshScope
public class BAction {

    @Value("${age}")
    private  String age;

    @Autowired
    private ServiceB serviceB;

    @RequestMapping("/add")
    public int add(int x, int y)
    {
        int sum  = serviceB.add(x,y);
        return sum;
    }

    @RequestMapping("/get")
    public String getAge()
    {
        return age;
    }

}
